#include <bits/stdc++.h>
using namespace std;
int max_sum(int* data,int n)
{
    assert(data != nullptr&&n>0);
    int sum_result = 0;
    int current_num = 0;
    for(int i=0;i<n;i++)
    {
        if(current_num<=0)
            current_num = data[i];
        else
            current_num += data[i];
        if(current_num>sum_result)
            sum_result = current_num;
    }
    return sum_result;

}
int main() {
    int a[] = {1,-2,3,10,-4,7,2,-5};
    int b = 7;
    cout<<dp(a,b);
    return 0;
}